package com.itheima.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDate;
import java.util.List;

@Mapper
public interface MemberMapper {

    /**
     * 获取日期列表
     * @return
     */
    @Select("select regTime from t_member")
    List<LocalDate> getMemberReport();

    /**
     * 获取所有会员数
     * @return
     */
    @Select("select count(*) from t_member")
    Integer getTotalMember();

    /**
     * 获取某个时间区间内的新增会员数
     * @param begin
     * @param end
     * @return
     */
    @Select("select count(*) from t_member where regTime in (#{begin} , #{end})")
    Integer getNewMember(LocalDate begin, LocalDate end);
}
